package com.mc.provider;


import org.springframework.boot.SpringApplication;
import org.springframework.boot.actuate.health.AbstractHealthIndicator;
import org.springframework.boot.actuate.health.Health;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.context.annotation.Bean;
import tk.mybatis.spring.annotation.MapperScan;

/**
 * 服务启动类
 *
 * @author LiuChunfu
 * @date 2018/1/3
 */
@EnableEurekaClient
@SpringBootApplication
@MapperScan("com.mc.provider.generate.mapper")
public class ProviderApplication {

    public static void main(String[] args) {
        SpringApplication.run(ProviderApplication.class, args);
    }

    //自定义服务实例健康状态,会使用到服务均衡中
    @Bean
    public AbstractHealthIndicator healthIndicator() {
        return new AbstractHealthIndicator() {
            @Override
            protected void doHealthCheck(Health.Builder builder) {
                builder.up().withDetail("msg", "个人定义的");
            }
        };
    }
}
